<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <title>出错了</title>
    <style>
        body { background: #f7f7f7; color: #333; font-family: 'Segoe UI', 'Arial', sans-serif; margin: 0; }
        .error-container { width: 100%; max-width: 1200px; margin: 80px auto; background: #fff; border-radius: 10px; box-shadow: 0 2px 12px rgba(0,0,0,0.10); padding: 48px 40px; text-align: center; }
        .error-title { font-size: 36px; color: #e74c3c; margin-bottom: 28px; }
        .error-msg { font-size: 20px; color: #555; margin-bottom: 36px; word-break: break-all; }
        .error-trace { text-align: left; background: #f9f9f9; color: #888; font-size: 16px; padding: 22px; border-radius: 6px; margin-bottom: 28px; overflow-x: auto; max-height: 600px; }
        .error-footer { color: #aaa; font-size: 16px; margin-top: 24px; }
        .error-details { text-align: left; }
        @media (max-width: 700px) {
            .error-container { padding: 20px 5vw; }
            .error-title { font-size: 24px; }
            .error-msg { font-size: 15px; }
            .error-trace { font-size: 12px; padding: 10px; }
        }
    </style>
</head>
<body>
    <?php
    // 检查调试模式
    $debug = !empty(config('app.debug'));
    ?>
    
    <div class="error-container">
        <div class="error-title">:( 出错了</div>
        <div class="error-msg">
            <?php echo isset($msg) ? htmlspecialchars($msg) : (isset($message) ? htmlspecialchars($message) : '未知错误'); ?>
        </div>
        
        <?php if ($debug && !empty($trace)): ?>
            <div class="error-trace">
                <b>详细信息：</b><br>
                <pre><?php echo htmlspecialchars($trace); ?></pre>
            </div>
        <?php endif; ?>
        
        <?php if ($debug): ?>
            <div class="error-details">
                <b>错误信息：</b><br>
                <div style="background: #f8f9fa; padding: 15px; border-radius: 4px; margin: 10px 0;">
                    <strong>错误代码：</strong> <?php echo http_response_code(); ?><br>
                    <strong>错误文件：</strong> <?php echo isset($exception) ? htmlspecialchars($exception->getFile()) : '未知'; ?><br>
                    <strong>错误行号：</strong> <?php echo isset($exception) ? $exception->getLine() : '未知'; ?><br>
                    <strong>错误类型：</strong> <?php echo isset($exception) ? get_class($exception) : '未知'; ?>
                </div>
            </div>
        <?php endif; ?>
        
        <div class="error-footer">FastPHP 框架 &copy; <?php echo date('Y'); ?></div>
    </div>
</body>
</html> 